package com.jsu.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.jsu.bean.CurrentMax;
import com.jsu.bean.FoundMessage;
import com.jsu.bean.Usr;
import com.jsu.dao.FoundMessageMapper;
import com.jsu.dao.UsrMapper;


@Component
public class ServiceDemo {
	
	@Autowired
	UsrMapper usrMapper;
	@Autowired
	CurrentMax currentMax;
	@Autowired
	GetLostFaceToken getLostFaceToken;
	@Autowired
	GetFoundFaceToken getFoundFaceToken;
	@Autowired
	LostMatchToFound lostMatchToFound;
	@Autowired
	FoundMatchToLost foundMatchToLost;
	
	String photoBasic="E:\\photo\\";
	
	public void insertUser(Usr usr){
		usrMapper.insert(usr);
	}
	public void lauchThread(){
		currentMax.setCurrentId(2);
		currentMax.setMaxId(3);
//		getLostFaceToken.setTar(currentMax,"E:\\photo\\");
//		Thread thread = new Thread(getLostFaceToken);
//		getFoundFaceToken.setTar(currentMax, "E:\\photo\\");
//		Thread thread = new Thread(getFoundFaceToken);
//		lostMatchToFound.setTar(currentMax);
//		Thread thread = new Thread(lostMatchToFound);
//		thread.start();
//		getFoundFaceToken.setTar(currentMax, photoBasic);
//		getFoundFaceToken.run();
//		getLostFaceToken.setTar(currentMax, photoBasic);
//		getLostFaceToken.run();
//		lostMatchToFound.setTar(currentMax, photoBasic);
//		lostMatchToFound.run();
		foundMatchToLost.setTar(currentMax, photoBasic);
		foundMatchToLost.run();
		System.out.println("continue======================================================");
	}
	
	public String testDemo() {
		String rntString = "返回结果";
		return rntString;
	}
}
